#ifndef __WIZ_DATATYPE_UTF_HPP__SHANHAOBO_19800429__
#define __WIZ_DATATYPE_UTF_HPP__SHANHAOBO_19800429__

#include "../../Base/WizBase.hpp"

namespace Wiz
{
    //////////////////////////////////////////////////////////////////////////

    namespace UTF8
    {
        namespace Char
        {
            WIZ_DECLARE(::Wiz::UInt8::Type);
        } /// end of namespace Char

		namespace String
		{
			class Type;
			WIZ_DECLARE(::Wiz::UTF8::String::Type);
		} /// end of namespace String
    } /// end of namespace UTF8

    namespace UTF16
    {
        namespace Char
        {
            WIZ_DECLARE(::Wiz::UInt16::Type);
        } /// end of namespace Char

		namespace String
		{
			class Type;
			WIZ_DECLARE(::Wiz::UTF16::String::Type);
		} /// end of namespace String
    } /// end of namespace UTF16

    namespace UTF32
    {
        namespace Char
        {
            WIZ_DECLARE(::Wiz::UInt32::Type);
		} /// end of namespace Char

		namespace String
		{
			class Type;
			WIZ_DECLARE(::Wiz::UTF32::String::Type);
		} /// end of namespace String
    } /// end of namespace UTF32

    //////////////////////////////////////////////////////////////////////////

    namespace UTF
    {
		/// Basic Multilingual Plane(BMP)
		/// UTF32BMP == UTF16
        static ::Wiz::UTF32::Char::TypeConst MaxBMP = 0xFFFF;
        static ::Wiz::UTF32::Char::TypeConst MaxUTF32 = 0x7FFFFFFF;
        static ::Wiz::UTF32::Char::TypeConst MaxLegalUTF32 = 0x0010FFFF;

        enum eResult
        {
            eSuccess,
            eSrcExhausted,
            eDestExhausted,
            eSrcIllegal
        };

        ////////////////////////////////////////////////////////////////////////

        WIZ_INLINE ::Wiz::Size32::Type UTF8Length
            (
            ::Wiz::UTF16::Char::InPtr   Src,
            ::Wiz::Size32::InOut        SrcBytes  /// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::Size32::Type UTF8Length
            (
            ::Wiz::UTF32::Char::InPtr   Src,
            ::Wiz::Size32::InOut        SrcBytes  /// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::Size32::Type UTF16Length
            (
            ::Wiz::UTF8::Char::InPtr    Src,
            ::Wiz::Size32::InOut        SrcBytes  /// In:Remained  Out:Used
            );

		WIZ_INLINE ::Wiz::Size32::Type UTF16Length
			(
			::Wiz::UTF32::Char::InPtr   Src,
			::Wiz::Size32::InOut        SrcBytes  /// In:Remained  Out:Used
			);

        WIZ_INLINE ::Wiz::Size32::Type UTF32Length
            (
            ::Wiz::UTF8::Char::InPtr    Src,
            ::Wiz::Size32::InOut        SrcBytes  /// In:Remained  Out:Used
            );

		WIZ_INLINE ::Wiz::Size32::Type UTF32Length
			(
			::Wiz::UTF16::Char::InPtr   Src,
			::Wiz::Size32::InOut        SrcBytes  /// In:Remained  Out:Used
			);

        ////////////////////////////////////////////////////////////////////////

        WIZ_INLINE ::Wiz::UTF::eResult ConvertUTF8toUTF16
            (
            ::Wiz::UTF16::Char::OutPtr  Dest,
            ::Wiz::Size32::InOut        DestBytes,  /// In:Remained  Out:Used
            ::Wiz::UTF8::Char::InPtr    Src,
            ::Wiz::Size32::InOut        SrcBytes	/// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::UTF::eResult ConvertUTF16toUTF8
            ( 
            ::Wiz::UTF8::Char::OutPtr   Dest,
            ::Wiz::Size32::InOut        DestBytes,  /// In:Remained  Out:Used
            ::Wiz::UTF16::Char::InPtr   Src,
            ::Wiz::Size32::InOut        SrcBytes	/// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::UTF::eResult ConvertUTF8toUTF32
            (
            ::Wiz::UTF32::Char::OutPtr  Dest,
            ::Wiz::Size32::InOut        DestBytes,  /// In:Remained  Out:Used
            ::Wiz::UTF8::Char::InPtr    Src,
            ::Wiz::Size32::InOut        SrcBytes	/// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::UTF::eResult ConvertUTF32toUTF8
            (
            ::Wiz::UTF8::Char::OutPtr   Dest,
            ::Wiz::Size32::InOut        DestBytes,  /// In:Remained  Out:Used
            ::Wiz::UTF32::Char::InPtr   Src,
            ::Wiz::Size32::InOut        SrcBytes	/// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::UTF::eResult ConvertUTF16toUTF32
            (
            ::Wiz::UTF32::Char::OutPtr  Dest,
            ::Wiz::Size32::InOut        DestBytes,  /// In:Remained  Out:Used
            ::Wiz::UTF16::Char::InPtr   Src,
            ::Wiz::Size32::InOut        SrcBytes	/// In:Remained  Out:Used
            );

        WIZ_INLINE ::Wiz::UTF::eResult ConvertUTF32toUTF16
            (
            ::Wiz::UTF16::Char::OutPtr  Dest,
            ::Wiz::Size32::InOut        DestBytes,  /// In:Remained  Out:Used
            ::Wiz::UTF32::Char::InPtr   Src,
            ::Wiz::Size32::InOut        SrcBytes	/// In:Remained  Out:Used
            );
    } /// end of namespace UTF
} /// end of namespace Wiz

#ifndef __WIZ_DATATYPE_UTF_INL__SHANHAOBO_19800429__
#define __WIZ_DATATYPE_UTF_INL__SHANHAOBO_19800429__
#include "./WizDataTypeUTF.inl"
#endif /// __WIZ_DATATYPE_UTF_INL__SHANHAOBO_19800429__

#endif /*__WIZ_DATATYPE_UTF_HPP__SHANHAOBO_19800429__*/
